
import { medal_listAll } from '@/api/medal'

class Medal {

    async getGroupList(){
        let groupList = new Array();
        let { data } = await medal_listAll({ company_id: localStorage.getItem('companyId') });
        if (data.status == 100) {
          groupList = data.data.rows.map(item => {
            return { value: item.id, label: item.medal_name }
          })
        }
        return groupList;
    }

    async getToolData(){
        const data = [
            {el: 'input', label: '勋章名称', model: 'medalrank_name'},
            {el: 'select', label: '分组名称', model: 'medal_id', options: await this.getGroupList()}
        ]
        return data;
    }
} 

const medal = new Medal();
export default medal;

export const close_status = [{ id: 0, label: '停用' }, { id: 1, label: '已启用' }]